Scenario #5001: Subscribe Existing Person and Contact to Mailinglist

UseCase Subscribe Existing Person And Contact To Mailinglist => Subscription: Michael Miller to operations-discussion

Properties

Required

Given

name value
partnerPersonTradeName Test AG
subscriberFamilyName Miller
subscriberGivenName Michael
subscriberEMailAddress michael.miller@example.org
mailingList operations-discussion

Person: Test AG

HTTP GET "/api/hs/office/persons?name=Test+AG" \
  -H "Authorization: Bearer $HSADMINNG_JWT_BEARER" \
  `# {` \
  `#   "sub" : "uuid<hsh-alex_superuser>"` \
  `# }`
=> status: 200 OK 
[ {
  "uuid" : "00ddd2fc-8742-46e5-924c-77749d4c8ccc", // Person: Test AG
  "personType" : "LEGAL_PERSON",
  "tradeName" : "Test AG",
  "salutation" : null,
  "title" : null,
  "givenName" : null,
  "familyName" : null
} ]

In production, data this query could result in multiple outputs. In that case, you have to find out which is the right one.

Person: Michael Miller

HTTP GET "/api/hs/office/persons?name=Miller" \
  -H "Authorization: Bearer $HSADMINNG_JWT_BEARER" \
  `# {` \
  `#   "sub" : "uuid<hsh-alex_superuser>"` \
  `# }`
=> status: 200 OK 
[ {
  "uuid" : "61c75b74-1a26-4e74-adc0-6506b455c4cd",
  "personType" : "NATURAL_PERSON",
  "tradeName" : null,
  "salutation" : null,
  "title" : null,
  "givenName" : "Michael",
  "familyName" : "Miller"
} ]

In real scenarios there are most likely multiple results and you have to choose the right one.

Contact: michael.miller@example.org

HTTP GET "/api/hs/office/contacts?emailAddress=michael.miller@example.org" \
  -H "Authorization: Bearer $HSADMINNG_JWT_BEARER" \
  `# {` \
  `#   "sub" : "uuid<hsh-alex_superuser>"` \
  `# }`
=> status: 200 OK 
[ {
  "uuid" : "508fc52c-61d6-42ce-bfb3-26899ffa5183",
  "caption" : "Michael Miller",
  "postalAddress" : { },
  "emailAddresses" : {
    "main" : "michael.miller@example.org"
  },
  "phoneNumbers" : { }
} ]

In real scenarios there are most likely multiple results and you have to choose the right one.

Subscribe Michael Miller to operations-discussion

HTTP POST "/api/hs/office/relations" \
  -H "Authorization: Bearer $HSADMINNG_JWT_BEARER" \
  `# {` \
  `#   "sub" : "uuid<hsh-alex_superuser>"` \
  `# }` \
  <<EOF
{
  "type" : "SUBSCRIBER",
  "mark" : "operations-discussion",
  "anchor.uuid" : "00ddd2fc-8742-46e5-924c-77749d4c8ccc", // Person: Test AG
  "holder.uuid" : "61c75b74-1a26-4e74-adc0-6506b455c4cd", // Person: Michael Miller
  "contact.uuid" : "508fc52c-61d6-42ce-bfb3-26899ffa5183" // Contact: michael.miller@example.org
}
EOF
=> status: 201 CREATED 56a5e6b7-7446-4ec5-a57f-1f879081fe7b

generated on 2026-08-10 01:37:55 for branch